package main.java.commands;

import java.util.ArrayList;

import org.xith3d.ui.hud.widgets.assemblies.HUDConsole;
import org.xith3d.utility.commands.Command;
import org.xith3d.utility.commands.CommandException;
import org.xith3d.utility.commands.CommandLine;

/** A test for the Command interface
 * 
 * @author Sven Berger
 *
 */
public class CmdTest implements Command
{
	private HUDConsole console=null;

	/**
	 * @param con
	 */
	public CmdTest(final HUDConsole con) {
		this.console=con;
	}

	@Override
	public Object[] createParametersArray(final ArrayList<String> parameters) {
		//what for? o.0
		return null;
	}

	@Override
	public String execute(final Object[] parameters) throws CommandException {
		this.console.println("Test successfull");
		return "Test closed";
	}

	@Override
	public String execute(final CommandLine commandLine) throws CommandException {
		this.console.println("Test successfull");
		return "Test closed";
	}

	@Override
	public String execute(final Boolean inputInfo, final Object[] parameters)
			throws CommandException {
		this.console.println("Test successfull");
		return "Test closed";
	}

	@Override
	public String execute(final Boolean inputInfo, final CommandLine commandLine)
			throws CommandException {
		this.console.println("Test successfull: "+commandLine.getParameters().get(0));
		return "Test closed";
	}

	@Override
	public String getKey() {
		return "CmdTest";
	}

	@Override
	public int getNumParameters() {
		return 1;
	}

	@Override
	public String[] getParameterTypes() {
		final String[] param={"String )"};
		return param;
	}

}
